<template>
	<div>
		<u-cell-group>
			<u-cell-item @click="subScribeMsg" icon="setting-fill" title="订阅消息通知"></u-cell-item>
			<!-- <u-cell-item icon="integral-fill" title="服务管理"  @click="$Go('/pages/myStore/comVip')"></u-cell-item> -->
		</u-cell-group>
	</div>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			subScribeMsg() { // 订阅信息
				uni.getSetting({
					withSubscriptions: true,
					success(res) {
						console.log('1', res.subscriptionsSetting);
						if (!res.subscriptionsSetting.mainSwitch) {
							uni.openSetting({ //打开设置页
								success(res) {
									console.log(res.authSetting);
								}
							})
						} else {
							uni.requestSubscribeMessage({
								tmplIds: ['AmzkrKW7FAcTh1z3YFEOvjqN1W0t5kjboreXHlvoMGk'],
								success(res) {
									console.log(res);
									if (res['AmzkrKW7FAcTh1z3YFEOvjqN1W0t5kjboreXHlvoMGk'] ==
										"accept") { // 用户点击确定后
										console.log('1111');
									}
								}
							})
						}
					}
				})
			},

		}
	}
</script>

<style>
</style>